CREATE TABLE [dbo].[Zach]
(
[Ik_zach] [int] NOT NULL IDENTITY(1, 1),
[Nn_zach] [char] (6) COLLATE Cyrillic_General_CI_AS NOT NULL,
[nCode] [numeric] (18, 0) NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Zach] WITH NOCHECK ADD CONSTRAINT [CheckZachNnZach] CHECK ((len([Nn_zach])=(6)))
GO
ALTER TABLE [dbo].[Zach] ADD CONSTRAINT [PK_Zach] PRIMARY KEY CLUSTERED  ([Ik_zach]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Zach] ADD CONSTRAINT [IX_Zach_1] UNIQUE NONCLUSTERED  ([Nn_zach]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Zach] WITH NOCHECK ADD CONSTRAINT [FK_Zach_Stud] FOREIGN KEY ([nCode]) REFERENCES [dbo].[Student] ([nCode])
GO
